﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Customer.Infrstructre.Migrations
{
    /// <inheritdoc />
    public partial class 客户 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Accounts",
                columns: table => new
                {
                    AccountsId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    AccountsNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AccountsName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FinanceTypeId = table.Column<int>(type: "int", nullable: true),
                    Lastpaydate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Payer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Beneficiary = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AccountsAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    PaymentNum = table.Column<int>(type: "int", nullable: true),
                    ReceivableState = table.Column<int>(type: "int", nullable: true),
                    RemaineAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    RRremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ApprovalStatus = table.Column<bool>(type: "bit", nullable: true),
                    Office_Id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    User_Id = table.Column<int>(type: "int", nullable: true),
                    PayMoney = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Accounts", x => x.AccountsId);
                });

            migrationBuilder.CreateTable(
                name: "FinanceTypes",
                columns: table => new
                {
                    FinanceTypeId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FinanceTypeCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FinanceTypeName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FRremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Office_Id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    User_Id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FinanceTypes", x => x.FinanceTypeId);
                });

            migrationBuilder.CreateTable(
                name: "NewCopes",
                columns: table => new
                {
                    NewPaidId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SerialNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PayInstitutions = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FinanceTypeId = table.Column<int>(type: "int", nullable: true),
                    Lastpaydate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PayMoney = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    CRremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Office_Id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    User_Id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_NewCopes", x => x.NewPaidId);
                });

            migrationBuilder.CreateTable(
                name: "NewPaids",
                columns: table => new
                {
                    NewPaidId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SerialNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PayInstitution = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FinanceTypeId = table.Column<int>(type: "int", nullable: true),
                    Lastpaydate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PayAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PRremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Office_Id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    User_Id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_NewPaids", x => x.NewPaidId);
                });

            migrationBuilder.CreateTable(
                name: "Procurements",
                columns: table => new
                {
                    ProcurementId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProcurementCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DocumentType = table.Column<int>(type: "int", nullable: true),
                    AssociateNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VendorId = table.Column<int>(type: "int", nullable: true),
                    ClientId = table.Column<int>(type: "int", nullable: true),
                    Pcontact = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Phone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReceiptDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PRremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MakePerson = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MarkTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    ProcureState = table.Column<int>(type: "int", nullable: true),
                    IsRecorded = table.Column<int>(type: "int", nullable: true),
                    Office_Id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    User_Id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Procurements", x => x.ProcurementId);
                });

            migrationBuilder.CreateTable(
                name: "ProcureProducts",
                columns: table => new
                {
                    ProcureProductId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ProcurementId = table.Column<int>(type: "int", nullable: true),
                    ProductsId = table.Column<int>(type: "int", nullable: true),
                    ProcureNum = table.Column<int>(type: "int", nullable: true),
                    Office_Id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    User_Id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProcureProducts", x => x.ProcureProductId);
                });

            migrationBuilder.CreateTable(
                name: "Receivables",
                columns: table => new
                {
                    ReceivableId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SerialNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReceivableName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    FinanceTypeId = table.Column<int>(type: "int", nullable: true),
                    Lastpaydate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Payer = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Beneficiary = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReceivableAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    PaymentNum = table.Column<int>(type: "int", nullable: true),
                    ReceivableState = table.Column<int>(type: "int", nullable: true),
                    RemaineAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    RRremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ApprovalStatus = table.Column<bool>(type: "bit", nullable: true),
                    Office_Id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    User_Id = table.Column<int>(type: "int", nullable: true),
                    PayInstitution = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PayAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Receivables", x => x.ReceivableId);
                });

            migrationBuilder.CreateTable(
                name: "Refunds",
                columns: table => new
                {
                    RefundId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RefundCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IsRefund = table.Column<int>(type: "int", nullable: true),
                    ProcurementId = table.Column<int>(type: "int", nullable: true),
                    ProductsId = table.Column<int>(type: "int", nullable: true),
                    RefundNum = table.Column<int>(type: "int", nullable: true),
                    SalesId = table.Column<int>(type: "int", nullable: true),
                    Office_Id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    User_Id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Refunds", x => x.RefundId);
                });

            migrationBuilder.CreateTable(
                name: "Saless",
                columns: table => new
                {
                    SalesId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SalesCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DocumentType = table.Column<int>(type: "int", nullable: true),
                    MorderNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ClientCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ClientName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SalesName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SalesPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ShipmentsTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Sremark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MakePerson = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SalesTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    SalesState = table.Column<int>(type: "int", nullable: true),
                    IsRecorded = table.Column<int>(type: "int", nullable: true),
                    OutShipment = table.Column<int>(type: "int", nullable: true),
                    Office_Id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    User_Id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Saless", x => x.SalesId);
                });

            migrationBuilder.CreateTable(
                name: "SellProducts",
                columns: table => new
                {
                    SellProductId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SalesId = table.Column<int>(type: "int", nullable: true),
                    ProductsId = table.Column<int>(type: "int", nullable: true),
                    SellProductNum = table.Column<int>(type: "int", nullable: true),
                    Office_Id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    User_Id = table.Column<int>(type: "int", nullable: true),
                    AddName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    AddTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    UpdName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UpdTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    DelName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DelTime = table.Column<DateTime>(type: "datetime2", nullable: true),
                    IsDel = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SellProducts", x => x.SellProductId);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Accounts");

            migrationBuilder.DropTable(
                name: "FinanceTypes");

            migrationBuilder.DropTable(
                name: "NewCopes");

            migrationBuilder.DropTable(
                name: "NewPaids");

            migrationBuilder.DropTable(
                name: "Procurements");

            migrationBuilder.DropTable(
                name: "ProcureProducts");

            migrationBuilder.DropTable(
                name: "Receivables");

            migrationBuilder.DropTable(
                name: "Refunds");

            migrationBuilder.DropTable(
                name: "Saless");

            migrationBuilder.DropTable(
                name: "SellProducts");
        }
    }
}
